import { createBrowserRouter } from "react-router-dom";
import { Link } from "react-router-dom";
const router = createBrowserRouter([
  {
    path: "/",
    async lazy() {
      const { default: App } = await import("../App.jsx");
      return {
        element: <App />,
      };
    },
    children: [
      {
        path: "/home",
        async lazy() {
          const { default: Home } = await import("../pages/home/index.tsx");
          return {
            element: <Home />,
          };
        },
      },
      {
        path: "/shop",
        async lazy() {
          const { default: Shop } = await import("../pages/shop/index.tsx");
          return {
            element: <Shop />,
          };
        },
      },
      {
        path: "/chat",
        async lazy() {
          const { default: Chat } = await import("../pages/chat/index.tsx");
          return {
            element: <Chat />,
          };
        },
      },
      {
        path: "/shopcat",
        async lazy() {
          const { default: Shopcat } = await import(
            "../pages/shopcat/index.tsx"
          );
          return {
            element: <Shopcat />,
          };
        },
      },
      {
        path: "/my",
        async lazy() {
          const { default: My } = await import("../pages/my/index.tsx");
          return {
            element: <My />,
          };
        },
      },
    ],
  },
]);
export default router;
